package com.be.beadmin.product.impl;

import com.be.beadmin.product.entity.ProductOrderInfo;
import com.be.beadmin.product.repository.ProductOrderInfoRepository;
import com.be.beadmin.product.service.ProductOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductOrderInfoServiceImpl implements ProductOrderInfoService {

    @Autowired
    private ProductOrderInfoRepository productOrderInfoRepository;

    @Override
    public List<ProductOrderInfo> getProduceOrderInfo(String matserialCode, String projectCode) {
        return productOrderInfoRepository.findProductOrderInfosByMaterialCodeAndProjectCode(matserialCode, projectCode);
    }

    @Override
    public void insertProductOrderInfo(ProductOrderInfo productOrderInfo) {
        productOrderInfoRepository.save(productOrderInfo);
    }
}
